title: Coupled van der Pol oscillators

description:

date: 2020-04-30

tags:

  • math

layout: layouts/post.njk

Coupled van der Pol oscillators https://scholarsarchive.library.albany.edu/cgi/viewcontent.cgi?article=1004&context=honorscollege_physics

$ g' = A sin ωt − γg − ω^2_0 z$

$z' = g$

In [1]:
from models.coupled.vanderpol import *
hv.notebook_extension()

van=get_plot()
In [2]:
van[0]
Out[2]:
In [3]:
van
Out[3]:
In [125]:
ω0 = 2500
ν = 100
µ = 10
ω2 = 300*25#554.365
A2=0
def deriv (y,t,A1,ω1):
    sine1=A1*np.sin(ω1 * t)
    sine2=A1*np.sin(ω2 *t)
    zprime = y[1]
    gprime = -ν *y[1]*(y[0]**2 - µ) - (ω0**2) * y[0] + sine1 + sine2
    return np.array([ zprime , gprime, sine1 ])
plt.figure()
y = odeint(deriv, [0.1,0.1,0.], np.linspace(0, 1., 600000),args=(5e6, 2200))  # with w0=2500, get resonance or beating
plot_and_play(y) 
/home/m/anaconda3/envs/tf/lib/python3.6/site-packages/ipykernel_launcher.py:45: UserWarning: No sound
In [42]:
plt.figure()
y = odeint(deriv, [0.1,0.1,0.], np.linspace(0, 1., 600000),args=(5e6, 2200))  # with w0=2500, get resonance or beating
plot_and_play(y) 
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
/home/m/anaconda3/envs/tf/lib/python3.6/site-packages/ipykernel_launcher.py:106: UserWarning: No sound
In [4]:
import os 
name='vanderpol_coupled_standalone'
path='~/mmy/jup/models/'
os.system(f'jupyter nbconvert {path}{name}.ipynb --to markdown --output {path}{name}')
os.system(f'jupyter nbconvert {path}{name}.ipynb --to markdown --output {path}{name}')
Out[4]:
0